package version1_2_3;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @program:IntelliJ IDEA
 * @Description:线程的主函数
 * @author:Mr.CheCheHuiBujianO
 * @data: 2022/7/13 11:35
 */
public class GameMain1_2_3 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //FutureTask的构造函数中封装了Callable接口
        FutureTask<String> gameResult = new FutureTask<>(new GameThread3());
        //创建线程类封装我们线程
        new Thread(gameResult).start();
        //拿出我们线程的返回值
        System.out.println(gameResult.get());
    }
}
